package com.fly.swt.launch;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class WorkShell extends Shell
{
    /**
     * Launch the application.
     * 
     * @param args
     */
    public static void main(String args[])
    {
        try
        {
            Display display = Display.getDefault();
            WorkShell shell = new WorkShell(display, SWT.SHELL_TRIM);
            shell.open();
            shell.layout();
            while (!shell.isDisposed())
            {
                if (!display.readAndDispatch())
                {
                    display.sleep();
                }
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
    /**
     * Create the shell.
     * 
     * @param display
     */
    public WorkShell(Display display, int style)
    {
        super(display, style);
        createContents();
    }
    
    /**
     * Create contents of the shell.
     */
    protected void createContents()
    {
        setText("SWT Application");
        setSize(450, 300);
    }
    
    @Override
    protected void checkSubclass()
    {
        // Disable the check that prevents subclassing of SWT components
    }
    
}
